<?php
require_once('engine/base.php');

class caja{
	
	public function getImportes($tipo){
		$anoMes = date('Y-m');
		$query = mysql_query('
					SELECT SUM(importe) AS suma
					FROM caja
					WHERE tipo = "'.$tipo.'"
					AND fecha BETWEEN "'.$anoMes.'-01" AND "'.$anoMes.'-31"
		');
		$value = mysql_fetch_object($query);
		return $value->suma;
	}
}
?>